/* Base Styles */
:root {
    --primary-color: #6366f1;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #f3f4f6;
    --card-bg: rgba(255, 255, 255, 0.7);
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-color);
    min-height: 100vh;
    line-height: 1.6;
    padding: 20px;
    position: relative;
    overflow-y: scroll; /* Always show scrollbar to prevent layout shift */
    transition: all 0.3s ease; /* Smooth transitions for all changes */
}

/* Prevent interaction during loading */
body.loading-active {
    pointer-events: none; /* Prevent interaction with the page while loading */
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect fill="none" width="100" height="100"/><rect fill="rgba(255,255,255,0.05)" width="50" height="50"/><rect fill="rgba(255,255,255,0.05)" x="50" y="50" width="50" height="50"/></svg>');
    opacity: 0.3;
    z-index: -1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.last-updated {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Glassmorphism Effects */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 15px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    padding: 25px 30px;
}

/* Card Styles */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-right: 20px;
    color: white;
}

.success-card .card-icon {
    background-color: var(--success-color);
}

.running-card .card-icon {
    background-color: var(--warning-color);
}

.failed-card .card-icon {
    background-color: var(--danger-color);
}

.card-content {
    flex: 1;
}

.card-content h2 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--text-light);
}

.card-value {
    font-size: 2.2rem;
    font-weight: 700;
}

/* Chart Section */
.chart-section {
    margin-bottom: 30px;
}

.chart-container {
    position: relative;
    height: 340px;
    overflow: hidden;
}

.chart-container canvas {
    margin-top: 10px;
    height: calc(100% - 50px) !important;
    width: 100% !important;
}

/* Improve Chart.js tooltip visibility */
#trend-chart {
    position: relative;
    z-index: 1;
}

.chart-tooltip {
    z-index: 100;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    min-height: 36px;
}

.chart-container h2 {
    color: white;
    font-size: 1.3rem;
    margin: 0;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    right: 0;
    top: 0;
    z-index: 5;
    height: 38px;
}

.toggle-btn .icon {
    font-style: normal;
    font-size: 1rem;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.toggle-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.7);
}

/* Table Section */
.table-section {
    margin-bottom: 20px;
}

.table-container {
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 20px;
}

.table-title {
    display: flex;
    flex-direction: column;
}

.table-header h2 {
    color: white;
    font-size: 1.4rem;
    margin: 0;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.table-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    margin-top: 5px;
}

/* Filter Styles */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: space-between;
    width: 100%;
}

.filter-group {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

.filter-group label {
    margin-right: 10px;
    color: white;
    font-size: 0.9rem;
    white-space: nowrap;
}

.filter-group select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
    outline: none;
}

.filter-group select:hover,
.filter-group select:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.filter-group select option {
    background: #4a5568;
    color: white;
}

.filter-group input[type="text"] {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    font-size: 0.9rem;
    width: 180px;
    transition: all 0.3s ease;
    outline: none;
}

.filter-group input[type="text"]:hover,
.filter-group input[type="text"]:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.table-responsive {
    overflow-x: auto;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 12px 15px;
    text-align: left;
    color: white;
}

table th {
    background: rgba(255, 255, 255, 0.1);
    font-weight: 600;
    position: sticky;
    top: 0;
}

table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s;
}

table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Status Colors */
.status {
    padding: 5px 10px;
    border-radius: 20px;
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-success {
    background-color: rgba(16, 185, 129, 0.4);
    color: #0a9f6d;
    border: 1px solid #0a9f6d;
}

.status-running {
    background-color: rgba(245, 158, 11, 0.4);
    color: #d18209;
    border: 1px solid #d18209;
}

.status-failed {
    background-color: rgba(239, 68, 68, 0.4);
    color: #dc2626;
    border: 1px solid #dc2626;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .table-title {
        margin-bottom: 15px;
    }
    
    .filters {
        width: 100%;
    }
    
    .filter-group {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .filter-group select,
    .filter-group input[type="text"] {
        width: 100%;
    }
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    flex-wrap: wrap;
    gap: 15px;
}

.pagination-info {
    font-size: 0.9rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    padding: 6px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.25);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 5px;
}

.page-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.1);
}

.page-number:hover {
    background: rgba(255, 255, 255, 0.2);
}

.page-number.active {
    background: var(--primary-color);
    font-weight: 600;
}

.page-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    color: rgba(255, 255, 255, 0.7);
}

.pagination-size {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-size select {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    padding: 6px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.pagination-size select:hover,
.pagination-size select:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.pagination-size select option {
    background: #4a5568;
    color: white;
}

/* Monthly Statistics Styles */
.monthly-stats-section {
    margin-bottom: 40px;
}

.monthly-stats-panel {
    padding: 25px 30px 30px 30px;
    border-radius: 15px;
    position: relative;
    overflow: visible;
    margin-bottom: 50px;
    min-height: auto;
    display: flex;
    flex-direction: column;
    height: auto;
}

.monthly-stats-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: auto;
}

.monthly-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 20px;
}

.monthly-stats-title-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    flex: 1;
}

.monthly-stats-title {
    display: flex;
    flex-direction: column;
}

.monthly-stats-title h2 {
    color: white;
    font-size: 1.3rem;
    margin: 0;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.monthly-stats-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-top: 5px;
}

.monthly-time-filter {
    margin-left: auto;
    margin-right: 35px;
    min-width: 430px;
}

.monthly-stats-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: flex-end;
    align-items: center;
    width: auto;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-item label {
    color: white;
    font-size: 0.9rem;
    white-space: nowrap;
}

.month-selector-wrapper {
    position: relative;
    width: 140px;
}

.month-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-style: normal;
    pointer-events: none;
}

#month-selector {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    padding: 8px 35px 8px 12px;
    font-size: 0.9rem;
    width: 100%;
    outline: none;
    transition: all 0.3s ease;
    z-index: 100;
}

#month-selector:hover, #month-selector:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

/* Make sure the Flatpickr calendar appears above other elements */
.flatpickr-calendar {
    z-index: 9999 !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    width: auto !important;
    min-width: 340px !important;
    max-width: 420px !important;
    padding: 8px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #4a5568, #2d3748);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 36px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.view-toggle-btn:hover {
    background: linear-gradient(135deg, #5a6578, #3d4758);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.view-toggle-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.view-toggle-btn i {
    font-size: 14px;
}

.monthly-stats-table-container {
    margin-top: 15px;
    border-radius: 10px 10px 0 0;
    overflow: visible;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    max-height: none;
    background: rgba(255, 255, 255, 0.05);
    height: auto;
}

#monthly-stats-table {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

#monthly-stats-table thead th {
    background: rgba(255, 255, 255, 0.15);
    font-weight: 600;
    padding: 14px 15px;
    position: sticky;
    top: 0;
    z-index: 2;
    text-align: center;
}

#monthly-stats-table tbody tr {
    transition: background-color 0.2s;
}

#monthly-stats-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#monthly-stats-table td {
    padding: 15px;
    text-align: center;
    vertical-align: middle;
}

#monthly-stats-table th {
    padding: 15px;
    text-align: center;
    vertical-align: middle;
    font-weight: 600;
    letter-spacing: 0.5px;
}

#monthly-stats-table tbody tr:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#monthly-stats-chart-view {
    height: auto;
    min-height: 500px;
    width: 100%;
    margin-top: 15px;
    position: relative;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-rate-high {
    color: var(--success-color);
    font-weight: bold;
    background: rgba(16, 185, 129, 0.1);
    padding: 6px 10px;
    border-radius: 20px;
    display: inline-block;
    min-width: 80px;
}

.success-rate-medium {
    color: var(--warning-color);
    font-weight: bold;
    background: rgba(245, 158, 11, 0.1);
    padding: 6px 10px;
    border-radius: 20px;
    display: inline-block;
    min-width: 80px;
}

.success-rate-low {
    color: var(--danger-color);
    font-weight: bold;
    background: rgba(239, 68, 68, 0.1);
    padding: 6px 10px;
    border-radius: 20px;
    display: inline-block;
    min-width: 80px;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .monthly-stats-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .monthly-stats-title-container {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .monthly-stats-controls {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .pagination-controls {
        width: 100%;
        justify-content: center;
    }
    
    .pagination-size {
        width: 100%;
        justify-content: flex-end;
    }
    
    .monthly-stats-title-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .monthly-time-filter {
        width: 100%;
        margin-top: 15px;
    }
    
    .monthly-stats-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .control-item {
        width: 100%;
    }
    
    .month-selector-wrapper {
        width: 100%;
    }
    
    .view-toggle-btn {
        width: 100%;
        margin-top: 10px;
    }
}

/* Make sure the content inside the panel doesn't overflow */
#monthly-stats-table-view, #monthly-stats-chart-view {
    overflow: visible;
}

/* 月度统计分页样式 */
#monthly-stats-table-view .pagination-container {
    margin-top: 0;
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

#monthly-stats-table-view .pagination-info {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

#monthly-stats-table-view .pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

#monthly-stats-table-view .pagination-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

#monthly-stats-table-view .pagination-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#monthly-stats-table-view .pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#monthly-stats-table-view .page-numbers {
    display: flex;
    gap: 5px;
}

#monthly-stats-table-view .page-number {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

#monthly-stats-table-view .page-number:hover {
    background: rgba(255, 255, 255, 0.2);
}

#monthly-stats-table-view .page-number.active {
    background: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

#monthly-stats-table-view .page-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    color: rgba(255, 255, 255, 0.7);
}

#monthly-stats-table-view .pagination-size {
    display: flex;
    align-items: center;
    gap: 8px;
}

#monthly-stats-table-view .pagination-size label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

#monthly-stats-table-view .pagination-size select {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    padding: 6px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

#monthly-stats-table-view .pagination-size select:hover,
#monthly-stats-table-view .pagination-size select:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

#monthly-stats-table-view .pagination-size select option {
    background: #4a5568;
    color: white;
}

/* Add styles for the new time range controls */
.time-range-filter {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    flex-wrap: nowrap;
    width: auto;
    margin-left: auto;
    margin-right: 35px;
    min-width: 430px;
}

.time-range-filter label {
    font-size: 14px;
    color: #e0e0e0;
    margin-bottom: 0;
    white-space: nowrap;
    margin-right: 10px;
}

.time-range-inputs {
    display: flex;
    align-items: center;
    background: transparent;
    border-radius: 12px;
    padding: 8px 0;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    width: auto;
    max-width: 400px;
}

.time-input {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(99, 102, 241, 0.15);
    color: white;
    font-size: 14px;
    width: 170px;
    transition: all 0.3s ease;
}

.time-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
    background-color: rgba(99, 102, 241, 0.25);
}

.time-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.time-input-separator {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 10px;
}

.time-filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 36px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    margin-left: 15px;
    min-width: 80px;
}

.time-filter-btn:hover {
    background: linear-gradient(135deg, #7477f2, #5a52e7);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.time-filter-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.time-filter-btn i {
    font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .time-range-filter {
        flex-direction: column;
        width: 100%;
        margin-right: 0;
        min-width: auto;
    }
    
    .time-range-inputs {
        width: 100%;
        padding: 5px 0;
        max-width: none;
    }
    
    .time-input {
        width: calc(50% - 10px);
        padding: 7px 6px;
        font-size: 13px;
    }
    
    .time-input-separator {
        margin: 0 5px;
    }
    
    .time-filter-btn {
        width: 100%;
        margin-top: 8px;
        margin-left: 0;
    }
    
    .monthly-time-filter {
        margin-right: 0;
        min-width: auto;
    }
}

/* Loading indicator for partial refreshes */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Button Loading Animation */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading i, 
.btn-loading span {
    opacity: 0;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-top: -8px;
    margin-left: -8px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

/* Loading Dialog */
.loading-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Darker background for better contrast */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease; /* Slower transition */
    pointer-events: none;
    will-change: opacity, visibility;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

.loading-dialog.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.loading-dialog-content {
    background-color: rgba(23, 25, 35, 0.95);
    border-radius: 16px;
    padding: 30px 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    will-change: transform;
    min-width: 200px;
}

.loading-dialog-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    border-top-color: #6366f1;
    animation: spin 1.2s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
    margin-bottom: 20px;
    will-change: transform;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.loading-dialog-text {
    color: white;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Flatpickr customization for time pickers */
.flatpickr-months {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border-radius: 8px 8px 0 0;
    padding: 5px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    height: 34px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg {
    width: 16px;
    height: 16px;
}

.flatpickr-months .flatpickr-month {
    color: rgba(255, 255, 255, 0.9);
    height: auto;
    display: flex;
    align-items: center;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: transparent;
    color: white;
    font-weight: 500;
}

.flatpickr-weekdays {
    background: rgba(240, 240, 240, 0.8);
}

.flatpickr-weekday {
    color: #4a5568;
}

.flatpickr-day {
    color: #4a5568;
    border-radius: 4px;
}

.flatpickr-day:hover {
    background: rgba(99, 102, 241, 0.1);
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.inRange,
.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange,
.flatpickr-day.selected:focus,
.flatpickr-day.startRange:focus,
.flatpickr-day.endRange:focus,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover,
.flatpickr-day.selected.prevMonthDay,
.flatpickr-day.startRange.prevMonthDay,
.flatpickr-day.endRange.prevMonthDay,
.flatpickr-day.selected.nextMonthDay,
.flatpickr-day.startRange.nextMonthDay,
.flatpickr-day.endRange.nextMonthDay {
    background: #6366f1;
    border-color: #6366f1;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
    color: white;
}

.flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)),
.flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)),
.flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1)) {
    box-shadow: -10px 0 0 #6366f1;
}

.flatpickr-time {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(245, 245, 245, 0.95);
    padding: 10px 5px;
    height: auto;
    max-width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 8px 8px;
    width: 100%;
    box-sizing: border-box;
    min-height: 50px;
}

.flatpickr-time .numInputWrapper {
    flex: 1;
    height: auto;
    max-width: 85px;
    margin: 0 2px;
}

/* Make space for seconds */
.flatpickr-time .flatpickr-time-separator {
    margin: 0 1px;
    color: #4a5568;
}

/* Ensure seconds are fully visible */
.flatpickr-time .numInputWrapper:nth-child(3) {
    margin-right: 5px;
}

.flatpickr-time .numInput {
    width: 100%;
}

.flatpickr-time .numInputWrapper span.arrowUp:after,
.flatpickr-time .numInputWrapper span.arrowDown:after {
    border-color: rgba(0, 0, 0, 0.5);
}

.flatpickr-time input {
    color: #1f2937;
    font-size: 14px;
    font-weight: 500;
    height: 30px;
    background: rgba(255, 255, 255, 0.5);
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    min-width: 75px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.flatpickr-time .flatpickr-am-pm {
    color: #4a5568;
    width: auto;
    padding: 0 5px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Monthly stats controls */
.monthly-stats-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
}

/* Loading message in tables */
.loading-message {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    background: rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.error-message {
    text-align: center;
    padding: 20px;
    color: #ef4444;
    font-size: 14px;
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid #ef4444;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .time-range-filter {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .time-range-inputs {
        flex-direction: row;
        align-items: center;
        width: 100%;
    }
    
    .time-input {
        width: calc(50% - 15px);
    }
    
    .time-input-separator {
        margin: 0 5px;
    }
    
    .time-filter-btn {
        margin-left: 10px;
    }
    
    .monthly-time-filter {
        margin-right: 0;
    }
}

.flatpickr-innerContainer {
    width: 100% !important;
    max-width: 100% !important;
}

.flatpickr-rContainer {
    width: 100% !important;
    max-width: 100% !important;
}

.flatpickr-days {
    width: 100% !important;
    max-width: 100% !important;
}

.dayContainer {
    width: 100% !important;
    max-width: 100% !important;
    min-width: auto !important;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    padding: 5px 0;
}

.flatpickr-day {
    color: #4a5568;
    border-radius: 4px;
    max-width: 38px;
    height: 38px;
    line-height: 38px;
    margin: 2px;
    flex: 0 0 38px;
} 